// 计算响应时长
module.exports = async (ctx, next) => {
    var pre = +new Date();
    await next();
    var duration = +new Date() - pre;
    ctx.set('X-Response-Time', duration);
}